Rectangle $ABCD$ has area $2006.$ An ellipse with area $2006\pi$ passes through $A$ and $C$ and has foci at $B$ and $D$. What is the perimeter of the rectangle?
Let $2a$ and $2b$ be the lengths of the major and minor axes of the ellipse, respectively, and let the dimensions of the rectangle be $x$ and $y.$ Then $x+y$ is the sum of the distances from the foci to point $A$ on the ellipse, which is $2a,$ so $x+y=2a.$ Also, the length of a diagonal of the rectangle is $\sqrt{x^2+y^2},$ which is also equal to the distance between the foci of the ellipse, which is $2\sqrt{a^2-b^2}.$ Thus, $x^2+y^2 = 4(a^2-b^2).$ Then the area of the rectangle is \[
2006=xy=r\frac{1}{2}\displaystyle\left[(x+y)^2-(x^2+y^2)\displaystyle\right]=r\frac{1}{2}\displaystyle\left[(2a)^2-(4a^2-4b^2)\displaystyle\right]=2b^2,
\]so $b=\sqrt{1003}.$ Thus, the area of the ellipse is \[
2006\pi=\pi ab=\pi a\sqrt{1003}.
\]Thus, $a=2\sqrt{1003},$ and the perimeter of the rectangle is $2(x+y)=4a=\boxed{8\sqrt{1003}}.$
[asy]
size(7cm);

real l=9,
w=7,
ang=asin(w/sqrt(l*l+w*w))*180/pi;
draw((-l,-w)--(l,-w)--(l,w)--(-l,w)--cycle);
draw(rotate(ang)*ellipse((0,0),2*l+2*w,l*w*2/sqrt(l^2+w^2)));
label("$A$",(-l,w),NW);
label("$B$",(-l,-w),SW);
label("$C$",(l,-w),SE);
label("$D$",(l,w),NE);
// Made by chezbgone2
[/asy]